'''
Descripttion: 
Author: White
Date: 2024-12-30 11:38:12
LastEditTime: 2024-12-30 12:22:28
'''
from db import db


# 故障设备信息
class Equipment_fault(db.Model):
    __tablename__ = 'tb_equipment_fault'
    # 故障序号
    sequence_id = db.Column(db.String(255), primary_key=True)
    sequence_name = db.Column(db.String(255))
    equipment_id = db.Column(db.String(255))
    failure_date = db.Column(db.String(255))
    fault_message = db.Column(db.String(255))
    person = db.Column(db.String(255))

    def __init__(self, sequence_id, sequence_name, equipment_id, failure_date, fault_message, person):
        self.equipment_id = equipment_id
        self.sequence_id = sequence_id
        self.sequence_name = sequence_name
        self.failure_date = failure_date
        self.fault_message = fault_message
        self.person = person

    def get(self):
        return {
            "equipment_id": self.equipment_id,
            "sequence_id": self.sequence_id,
            "sequence_name": self.sequence_name,
            "failure_date": self.failure_date,
            "fault_message": self.fault_message,
            "person": self.person
        }

    def __repr__(self):
        return f'<Equipment_fault {self.sequence_name}>'
